<template>
  <el-row>
    <el-form :model="addForm" label-width="80px" :rules="addFormRules" ref="addForm">
      <el-form-item label="用户名" prop="username">
        <el-input v-model="addForm.username" auto-complete="off"></el-input>
      </el-form-item>
      <el-form-item label="密码" prop="password">
        <el-input v-model="addForm.password" auto-complete="off"></el-input>
      </el-form-item>
      <el-form-item label="姓名" prop="name">
        <el-input v-model="addForm.name" auto-complete="off"></el-input>
      </el-form-item>
      <el-form-item label="出生日期" prop="birth">
        <el-date-picker type="date" placeholder="出生日期" v-model="addForm.birth"></el-date-picker>
      </el-form-item>
      <el-form-item label="邮箱" prop="email">
        <el-input type="email" v-model="addForm.email"></el-input>
      </el-form-item>
      <el-form-item label="角色" prop="roleIds">
        <el-checkbox-group v-model="roleIds">
          <el-checkbox v-for="role in roles" :label="role.roleId" :key="role.roleId">{{role.roleName}}
          </el-checkbox>
        </el-checkbox-group>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click.native="addFormVisible = false">取消</el-button>
      <el-button type="primary" @click.native="addSubmit" :loading="addLoading">提交</el-button>
    </div>
  </el-row>
</template>

<script>
  export default {
    name: "add",
    data() {
      return {
        addForm: {
          username: "",
          password: "",
          name: "",
          email: "",
          roleIds: []
        }
      }
    }
  }
</script>

<style scoped>

</style>
